package com.jh.paymentchannel.util;

import cn.jh.common.utils.CommonConstants;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author Yichuan
 * @version 1.0
 */
public class RetMap implements Serializable {

    private static final long serialVersionUID = -1944893103600998198L;

    private String code;
    private String message;
    private Object result;

    public RetMap() {
        super();
    }

    public RetMap(String code, String message, Object result) {
        this.code = code;
        this.message = message;
        this.result = result;
    }

    @JsonProperty("resp_code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @JsonProperty("resp_message")
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public boolean isSuccess() {
        return Objects.equals(code, CommonConstants.SUCCESS);
    }
}
